Skip to content

Conversation

@MasterPtato
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rivetkit-serverless Error Error Dec 11, 2025 9:05pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ignored Ignored Dec 11, 2025 9:05pm
rivet-inspector Ignored Ignored Preview Dec 11, 2025 9:05pm
rivet-site Ignored Ignored Preview Dec 11, 2025 9:05pm

Copy link
Contributor Author

MasterPtato commented Dec 11, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Dec 11, 2025

Code Review - PR #3630: Clean up scripts

Overview

This PR migrates TypeScript scripts from Deno to Node.js (via tsx), removing Deno-specific configuration and dependencies. The changes simplify the tooling stack by standardizing on Node.js for all TypeScript scripts.

✅ Positive Changes

  1. Standardization: Moving to tsx/Node.js reduces tooling complexity and aligns with the rest of the codebase's use of pnpm workspace
  2. Dependency Management: Adding @iarna/toml and fast-glob to package.json makes dependencies explicit and version-locked
  3. Better Error Handling: In gen_rust.ts, throwing proper Error objects instead of strings is more idiomatic

🔍 Issues & Recommendations

1. Unused Import (scripts/openapi/gen_rust.ts:5)

import { promisify } from 'node:util';

Issue: The promisify import is never used in the file.
Recommendation: Remove this unused import.

2. Error Handling Inconsistency (scripts/openapi/gen_rust.ts:91-99)

try {
	content = await readFile(filePath, 'utf-8');
} catch (error: any) {
	if (error.code === 'ENOENT') {
		console.warn(`File not found: [FILE]`);
		continue;
	} else {
		throw error;
	}
}

Issue: Using any type for error bypasses TypeScript's type safety.
Recommendation: Use a type guard instead.

3. Fallback UID/GID Values (scripts/openapi/gen_rust.ts:37-38)

const uid = process.getuid?.() ?? 1000;
const gid = process.getgid?.() ?? 1000;

Issue: Hardcoded fallback to 1000 may not match actual user/group IDs on Windows or in some CI environments, potentially causing Docker permission issues.
Recommendation: Consider logging when fallback values are used.

4. Missing Type Safety (scripts/cargo/update_workspace.ts:24, 73)

const workspaceToml = parse(workspaceTomlContent) as any;
const packageToml = parse(packageTomlContent) as any;

Issue: Using as any bypasses type safety for TOML parsing results.
Recommendation: Define minimal types for the parts you access.

5. Command Execution Best Practice (scripts/openapi/gen_rust.ts:14-16)

const child = spawn(command, args, {
	stdio: 'inherit',
	cwd: process.cwd(),
});

Issue: Explicitly setting cwd to process.cwd() is redundant since that's the default.
Recommendation: Can be simplified by removing the cwd parameter.

📊 Summary

Severity Breakdown:

  • 🔴 High: 0
  • 🟡 Medium: 2 (type safety issues)
  • 🟢 Low: 3 (unused import, redundant code, logging opportunity)

Overall Assessment: ✅ Approve with minor suggestions

The migration is well-executed and functional. The identified issues are minor and relate to code quality rather than correctness. The PR successfully achieves its goal of consolidating tooling.

Action Items:

  1. Remove unused promisify import
  2. Consider improving error type handling
  3. Consider adding type interfaces for TOML parsing
  4. Optional: Add logging for UID/GID fallbacks

Review generated by Claude Code

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 11, 2025

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@3630

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@3630

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@3630

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@3630

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@3630

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@3630

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@3630

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@3630

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@3630

commit: a5b7459

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 12, 2025

Merge activity

  • Dec 12, 12:48 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Dec 12, 12:49 AM UTC: CI is running for this pull request on a draft pull request (#3634) due to your merge queue CI optimization settings.
  • Dec 12, 12:49 AM UTC: Merged by the Graphite merge queue via draft PR: #3634.

graphite-app bot pushed a commit that referenced this pull request Dec 12, 2025
@graphite-app graphite-app bot closed this Dec 12, 2025
@graphite-app graphite-app bot deleted the 12-11-chore_clean_up_scripts branch December 12, 2025 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants